/**
 * 
 * 广州锐鹏计算机科技有限公司（www.ruipengkj.com）
 * 
 * 
 * Copyright (c) 2011-2012 RUIPENGKJ.Co.Ltd. All rights reserved.
 * 
 * */
package com.ruipengkj.bean;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 说明：
 * Entity Name 公司部门
 * @Author：李智深
 * @Date：2012-03-14
 */
@Entity
@Table(name="ruipeng_tb_TDept")
public class TDept implements Serializable{

	private static final long serialVersionUID = 1L;

	private String DeptID;//部门编号CHAR(15) PK
	
	private String Name;//部门名称VARCHAR(64)
	
	private Date HappenTime=new Date();//创建日期DATETIME
	
	private String Operator;//创建人  CHAR(15)
	
	private String Des;//部门说明 VARCHAR(512)
	
	private Set<TEmployee> TEmployees=new HashSet<TEmployee>(0);//下属员工
	
	public TDept(){}
	
	public TDept(String deptID){
		this.DeptID=deptID;
	}
	
	@Id
	@Column(name = "DeptID", length=15)
	public String getDeptID() {
		return DeptID;
	}

	public void setDeptID(String deptID) {
		DeptID = deptID;
	}

	@Column(name = "Name", length=64)
	public String getName() {
		return Name;
	}

	public void setName(String name) {
		Name = name;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "HappenTime", nullable = false, length = 19)
	public Date getHappenTime() {
		return HappenTime;
	}

	public void setHappenTime(Date happenTime) {
		HappenTime = happenTime;
	}

	@Column(name = "Operator", length=15)
	public String getOperator() {
		return Operator;
	}

	public void setOperator(String operator) {
		Operator = operator;
	}

	@Column(name = "Des", length=512)
	public String getDes() {
		return Des;
	}

	public void setDes(String des) {
		Des = des;
	}
	@OneToMany(mappedBy="TDept",fetch=FetchType.EAGER)
	@JoinColumn(name="DeptID")
	public Set<TEmployee> getTEmployees() {
		return TEmployees;
	}

	public void setTEmployees(Set<TEmployee> tEmployees) {
		TEmployees = tEmployees;
	}
}
